#include<stdio.h>
float a;
float b;
double c;   
char op;
void main()
{
    printf("请输入第一个操作数:");
    scanf("%f",&a);
    printf("请输入操作符:");
    getchar();
    op=getchar();
    printf("请输入第二个操作数:");
    scanf("%d",&b);

    switch(op)   
    {
        case'+':
            c=a+b;
            break;
        case'-':
            c=a-b;
            break;
        case'*':
            c=a*b;
            break;
        case'/':
            c =(double)a / b;
            break;
        case 'c':
            return 0;
            
        default:
            printf("无效的操作符。\n");
            break;
    }
      printf("the result is %f\n", c);

}


